<template>
    <el-form :model="form" label-width="auto" style="max-width: 600px">
        <el-form-item label="账号：">
            <el-input v-model="form.account" />
        </el-form-item>
        <el-form-item label="密码：">
            <el-input type="password" v-model="form.password" />
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="onSubmit">登录</el-button>
        </el-form-item>
    </el-form>
</template>

<script setup>
import request from '@/request/request';
import { ref } from 'vue';

const form = ref({
    account: '',
    password: ''
});
function onSubmit() {
    request('POST', 'blog-auth/auth/login', form.value, true).then(
        result => {
            console.log(result);
        }
    ).catch(
        error => {
            console.error(error.response.data);
        }
    )
}
</script>